home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
mc51bugs
/
q32514
< prev
next >
Wrap
Text File
|
1988-07-20
|
1KB
|
47 lines
Q32514 Getw Does Not Return EOF with One Byte in File
C Compiler
5.10 | 5.10
MS-DOS | OS/2
Summary:
An attempt to read the last byte from a file using the run-time
function getw() may fail. The function incorrectly returns a
corruption of the last byte and one byte of the EOF value.
The following program illustrates this problem:
#include <stdio.h>
#include <stdlib.h>
FILE *stream;
int i;
main()
{
stream = fopen("t.in", "wb");
i = putc('a',stream);
if ( i != (int)'a' )
{
printf("Write failure, test is invalid\n");
fclose(stream);
}
else
{
fclose(stream);
stream = fopen("t.in", "rb");
i = getw(stream);
if ( i == EOF )
printf("passed\n");
else
printf("failed\n");
}
}
Microsoft has confirmed this to be a problem in Version 5.10
of the C compiler. We are researching this problem and will post new
information as it becomes available.
Keywords: buglist5.10 qfbv
Updated 88/07/21 03:19